package com.testfileupload.uploadimg.design.proxy;

public class Proxy implements Subject {
    //要代理的实现类
    private Subject realSubject = null;

    @Override
    public void request() {
        this.before();
        this.realSubject.request();
        this.after();
    }

    public Proxy(Subject subject) {
        this.realSubject = subject;
    }

    private void before() {
        System.out.println("before");
    }

    private void after() {
        System.out.println("after");
    }
}
